﻿using SeleniumExtension.Models;
using SeleniumExtension.WebDriver;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SeleniumExtension.Engine
{
    public class Core
    {
        public static List<Results> Run(Options searchOptions)
        {
            List<Results> results = new List<Results>();
            try
            {
                InternetExplorer.Instance.Manage().Window.Maximize();
                results = new Search.LinkText().Search(searchOptions);
            }
            catch (Exception ex)
            { throw ex; }
            finally
            {
                InternetExplorer.Instance.Close();
                InternetExplorer.Instance.Quit();
            }
            return results;
        }
    }
}
